<?php

$loader->requireOnce('controllers/C_ResidentPatient.class.php');
/**
 * Controller for patient detail pages including edit demographic info,
 * check-in a department, input medicine, service,...
 * 
 * @package core.controllers
 * @author ptnguyen
 * @version $Id:$
 * @copyright 2009 LHV Company
 */
class C_EmerResidentPatient extends C_ResidentPatient {
	
	var $logger;
	var $template_mod;
	
    public function C_EmerResidentPatient($template_mod = "general") {
        parent::Controller();
        $this->logger = &LoggerManager::getLogger('core.controllers.C_EmerResidentPatient');
        if (Celini::getCurrentController() == 'EmerResidentPatient') {
            $menu =& Menu::getInstance();
            $menu->currentSection = 'patient';
        }
        $this->template_mod = $template_mod;        
        $this->view->path = 'emer_resident_patient';
    }
    
    /**
     * 
     * @return HTML
     */
    public function actionRenderPatientBox() {
    	$patientId = $_GET['patientId'];
    	
    	$person = Celini::newORDO('Person', $patientId);
		$patient = Celini::newORDO('Patient', $patientId);

		$this->assign('patientName', $person->get('name'));
		$this->assign('patientCode', $patient->get('patient_code'));
		$this->assign('patientDob', $person->getDateofBirth());
		$this->assign('patientAge', $person->getAge());
		$this->assign('lastExam', $patient->getLastExamDate());
   		$this->assign('display', $nextAction);
    	$this->assign('patientId', $patientId);
		$this->assign('selected', 2);
		
    	return $this->view->render("patient_box.html");
    }
}
?>